﻿using System;

namespace ConsoleUtility.Command
{
    /// <summary>
    /// 方法特性
    /// </summary>
    [AttributeUsage(AttributeTargets.Method)]
    public class MethodAttribute : Attribute
    {
        /// <summary>
        /// 名称
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 字符
        /// </summary>
        public char? Character { get; set; }

        /// <summary>
        /// 初始化
        /// </summary>
        /// <param name="name">名称</param>
        public MethodAttribute(string name)
        {
            Name = name;
            Character = null;
        }

        /// <summary>
        /// 初始化
        /// </summary>
        /// <param name="name">名称</param>
        /// <param name="character">字符</param>
        public MethodAttribute(string name, char character)
        {
            Name = name;
            Character = character;
        }
    }
}
